﻿using Stratrgy;

if (args.Length != 2)
{
    Console.WriteLine("Usage: C# Program randomseed1 randomseed2");
    Console.WriteLine("Example: dotnet run 314 15");
}

var seed1 = int.Parse(args[0]);
var seed2 = int.Parse(args[1]);
var player1 = new Player("Taro", new WinningStrategy(seed1));
var player2 = new Player("Hana", new ProbStrategy(seed2));

for (var i = 0; i < 100; i++)
{
    var nextHand1 = player1.NextHand();
    var nextHand2 = player2.NextHand();
    if (nextHand1.IsStrongerThan(nextHand2))
    {
        Console.WriteLine($"Winner:{player1}");
        player1.Win();
        player2.Lose();
    }
    else if (nextHand2.IsStrongerThan(nextHand1)) 
    {
        Console.WriteLine($"Winner:{player2}");
        player1.Lose();
        player2.Win();
    }
    else 
    {
        Console.WriteLine("Even...");
        player1.Even();
        player2.Even();
    }
}

Console.WriteLine("Total Result:");
Console.WriteLine(player1.ToString());
Console.WriteLine(player2.ToString());
